package StudyCode.summary.mycollection;

import java.util.Collections;
import java.util.Vector;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class PerformBinarySearchOnVector {
	public static void main(String[] args) {
		Vector v = new Vector();
		v.add("A");
		v.add("B");
		v.add("D");
		v.add("E");
		v.add("F");

		Collections.sort(v);

		int index = Collections.binarySearch(v, "D");

		System.out.println("元素 D 的索引是 : " + index);
	}
}
